﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using TTGStudios.NotificationCenterNET;

namespace ExampleUsageApp
{
	public class Logger
	{
		// This class knows nothing about the UI that is sending these messages.
		public Logger()
		{
			NotificationCenter<Message>.Instance.SubscribeToMessage(Message.EnglishUnitsSelected, (m, s, e) =>
				{
					MessageBox.Show("English units chosen", "Logging module");
				});

			NotificationCenter<Message>.Instance.SubscribeToMessage(Message.MetricUnitsSelected, (m, s, e) =>
			{
				MessageBox.Show("Metric units chosen", "Logging module");
			});

			NotificationCenter<Message>.Instance.SubscribeToMessage(Message.SaveToSkyDriveChanged, (m, s, e) =>
			{
				bool save = (bool)e;
				MessageBox.Show("Save to SkyDrive is " + (save ? "ON" : "OFF"), "Logging module");
			});
		}
	}
}
